<template>
  <avue-form v-model="form"
             :option="option"></avue-form>
</template>
<script>
let baseUrl = 'https://cli.avuejs.com/api/area'
export default {
  data () {
    return {
      form: {
        province: '110000'
      },
      option: {
        column: [
          {
            label: '城市',
            prop: 'province',
            type: 'select',
            props: {
              label: 'name',
              value: 'code'
            },
            dicFormatter: (data) => {
              data.forEach(ele => {
                ele.name = ele.name + '字典格式化'
              })
              data.unshift({ name: '追加字典', code: -1 })
              return data
            },
            dicUrl: `${baseUrl}/getProvince`
          }]
      }
    }
  }
}
</script>